#include "parse_tree.h"
extern parse_tree *parse(const char*);

int main(int argc, char *argv[])
{
    parse_tree *tree = NULL;
    const char *input = NULL;

    if (argc == 2) {
        input = argv[1];
    } else if(argc < 2 || argc >= 3) {
        printf("usage: %s <sysy_file>\n", argv[0]);
        return 1;
    }

    // Call the parse analyzer.
    tree = parse(input);
    print_parse_tree(stdout, tree);
    del_parse_tree(tree);
    return 0;
}
